package org.jeecg.modules.iot.model;

import lombok.Data;
import lombok.NoArgsConstructor;

import java.sql.Timestamp;
@Data
@NoArgsConstructor
public class Location {
    private Timestamp ts;
    private Integer alarm; //告警信息 4字节
    private Integer statusField;//状态 4字节
    private Double latitude;//纬度 4字节
    private Double longitude;//经度 4字节
    private short elevation;//海拔高度 2字节
    private short speed; //速度 2字节
    private short direction; //方向 2字节
    private String tableName;
    private String seq;
    private String deviceId ;
    private String onlineStatus ;


    private  Integer snnNumber;
    //总计里程
    private Float  mileage;
    //剩余里程
    private Float rMileage=0f;

    //单次里程
    private Float sMileage;

    //单天里程
    private Float dMileage=0f;

    //每过500清零一次
    private Float fMileage=0f;

    // 每公里能耗
    private Float eConsum=0f;
    //当前功耗
    private Float sConsum=0f;



    //是否租赁
    private Integer isLease;





    public Location(Timestamp ts, int alarm, Double latitude, int statusField, Double longitude, short elevation, short speed, short direction,String seq,String deviceId) {
        this.ts = ts;
        this.alarm = alarm;
        this.latitude = latitude;
        this.statusField = statusField;
        this.longitude = longitude;
        this.elevation = elevation;
        this.speed = speed;
        this.direction = direction;
        this.seq=seq;
        this.deviceId=deviceId;
    }



    public void setDeviceId(String deviceId) {
        this.deviceId = deviceId;
        this.tableName="t"+deviceId;
    }

    public Location(Timestamp ts, Double latitude, Double longitude, short speed, String seq) {
        this.ts = ts;
        this.longitude = longitude;
        this.latitude = latitude;
        this.speed = speed;
        this.seq = seq;
    }

    public Location(Timestamp ts, int alarm, int statusField, Double longitude, Double latitude, short speed, String seq) {
        this.ts = ts;
        this.alarm = alarm;
        this.statusField = statusField;
        this.longitude = longitude;
        this.latitude = latitude;
        this.speed = speed;
        this.seq = seq;
    }
}
